package com.cqgcxy.shopping.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cqgcxy.shopping.common.CommException;



@WebServlet(urlPatterns="/user/addCart.do")
public class CartServlet extends HttpServlet{


	
	private static final long serialVersionUID = 9183667839977684487L;
	private Logger logger =LoggerFactory.getLogger(getClass());
    private GoodsListServlet  goodsListServlet=new GoodsListServlet();
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	
		logger.debug("addCart.do");
		
		try {
			
			//1.抽取参数
			String goodscode = req.getParameter("goodscode");
			
			
			
			
			
			//2.类型转换
			
			
			//3.数据校验
			
			
			
			if(goodscode==null) {
				throw new CommException("商品ID为空");
			}
						
			
			//4.封装为对象
			
			
			
			//5.执行业务方法

			//6.转发或重定向
			
					
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		
		
	}
	

}
